package org.sidora.strata.context.types;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.TopComponent;
import org.sidora.core.context.Surface;
import org.sidora.strata.Storage;


/**
 * Action which shows Surface component
 * @author Enric Tartera, Juan Manuel Gimeno, Roger Masgoret
 * @version 1.0
 */
public class SurfaceAction extends AbstractAction {
    
    public SurfaceAction() {
        super(NbBundle.getMessage(SurfaceAction.class, "CTL_SurfaceAction"));
//        putValue(SMALL_ICON, new ImageIcon(Utilities.loadImage(SurfaceTopComponent.ICON_PATH, true)));
    }
    
    public void actionPerformed(ActionEvent evt) {
        TopComponent win = SurfaceTopComponent.findInstance();
        win.open();
        win.requestActive();
    }
        public void actionPerformed() {
        SurfaceTopComponent win = SurfaceTopComponent.findInstance();
        win.open();
        win.requestActive();
        win.fillItems();
    }
        
            public void fillItems(){
        emptyItems();
        Surface surface = (Surface) Storage.getContext();
        
    }
    
    
    public void emptyItems(){
        
    }
    
    public void cerrar(){
        SurfaceTopComponent win = SurfaceTopComponent.findInstance();
        win.close();
    }
}
